<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.goodedeeds.webapp.controller.SchoolAction" %>
<%@ page import="com.goodedeeds.domain.resource.School" %>
<%@ page import="com.goodedeeds.webapp.controller.ResourcePageAction" %>
<%--@elvariable id="actionBean" type="com.goodedeeds.webapp.controller.SchoolAction"--%>
<%@ include file="/WEB-INF/jsp/include/taglibs.jsp"%>
<div style="text-align: center; font-size: 1.5em;">School List</div>
<div>
    <stripes:link href="<%=SchoolAction.URL%>" event="edit">
        Create New School
    </stripes:link>
</div>

<c:if test="${!empty actionBean.schools}">
    <table>
        <tr>
            <td>School ID</td>
            <td>School Key</td>
            <td>School Name</td>
            <td>School Description</td>
            <td>School Status</td>
            <td>Actions</td>
        </tr>
        <c:forEach items="${actionBean.schools}" var="school">
            <tr>
                <td>${school.schoolId}</td>
                <td>${school.schoolKey}</td>
                <td>${school.schoolName}</td>
                <td>${school.schoolDescription}</td>
                <td>${school.schoolStatus}</td>
                <td>
                    <stripes:link href="<%=SchoolAction.URL%>" event="edit">
                        <stripes:param name="schoolId" value="${school.schoolId}"/>
                        Edit
                    </stripes:link> |
                    <stripes:link href="<%=SchoolAction.URL%>" event="view">
                        <stripes:param name="schoolId" value="${school.schoolId}"/>
                        View
                    </stripes:link>
                    |
                    <stripes:link href="<%=ResourcePageAction.URL%>" event="list">
                        <stripes:param name="pageResourceType" value="<%=School.RT_SCHOOL%>"/>
                        <stripes:param name="pageResourceId" value="${school.schoolId}"/>
                        Pages
                    </stripes:link>

                </td>
            </tr>
        </c:forEach>
    </table>
</c:if>